<%@ page language="java" import="java.util.*,org.bluebee.billiardsbar.dao.*,org.bluebee.billiardsbar.dao.impl.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'imgtablelist.jsp' starting page</title>
    <style type="text/css">
<!--
.style1 {
	font-size: x-small;
	color: #666666;
}

-->
</style>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="refresh" content="5">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <%String roomid=request.getParameter("roomid");
   	IBallDao balldao=new BallDaoImpl();
   	ArrayList<HashMap<String,Object>> list=balldao.getBallListOfRoom(roomid.trim());
   %>
   <table width="100%"  border="0">
  <%if(list!=null){
  		
  		int index=0;
  		int listsize1=list.size();
 		for ( int i = 0; i < list.size()/4+1; i++ ) { 
	%>
  <tr>
  			<%for(int j=0;j<(listsize1<4?listsize1:4);j++){ 
  				index=i*4+j;
  				
  				HashMap<String,Object> map = (HashMap<String,Object>)list.get(index);
				if(map!=null){
					%>
    <td><div align="center"><a href="main_capability/tableinfo.jsp?tableid=<%if(map.get("TABLEID")!=null)out.print(map.get("TABLEID").toString());%>" target="downframe">
    						<img  src="/billiardsbar/SOURCE/images/table.<%if(map.get("USERID").toString().trim().equals("0")){out.print("png");}else{out.print("jpg");} %>" width="153" height="104"/>
    						</a>
    	<br><label id="" for=""><span class="style1">
    	<%if(map.get("TABLEID")!=null)out.print(map.get("TABLEID").toString());%>：<%if(map.get("USERID").toString().trim().equals("0")){out.print("没有使用");}else{out.print("<font color='red'>使用中</font>");} %>
    	</span></label>
    	<br><label id="" for=""><span class="style1">已用时间</span></label></div></td>
  <%			}
  			}
  			listsize1-=4;%>
  </tr>
  		<%} 
  	}%>
</table>
  </body>
</html>
